【cherry-pick】upgrade triton moe config.#7979
Conversation
CI报告基于以下代码生成(30分钟更新一次): 1 Required任务 : 8/10 通过
2 失败详情🔴 Run FastDeploy Unit Tests and Coverage / run_tests_with_coverage — PR问题(置信度: 高)错误类型: PR问题 | 置信度: 高
关键日志:
PR 将 修复建议:
关联变更: 🔴 Approval — 需要 Approval(置信度: -)该 Job 需要人工 Approval,完成审批后 CI 才会继续执行。 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release/2.6 #7979 +/- ##
==============================================
Coverage ? 72.14%
==============================================
Files ? 386
Lines ? 55654
Branches ? 8740
==============================================
Hits ? 40152
Misses ? 12668
Partials ? 2834
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a45e569 to
a816e85
Compare
PaddlePaddle-bot
left a comment
There was a problem hiding this comment.
🤖 Paddle-CI-Agent | pr_review |
2026-06-03 20:01:04
📋 Review 摘要
PR 概述:为 Triton MoE backend 的 _get_default_config 新增 SM100 (B200) 预调优 tile config 查找表,通过最近邻匹配代替原有启发式规则;测试同步新增 SM100 路径覆盖并修复 GPU-model-independent 依赖问题。
变更范围:model_executor/layers/moe/、tests/layers/
影响面 Tag:[OP]
问题
未发现阻塞性问题。PR 规范问题在下面章节报,不要在这里重复。
历史 Findings 修复情况
| Finding | 问题 | 状态 |
|---|---|---|
| F1 | 热路径重复创建大型字典对象 | |
| F2 | SM80 (A100) 回退到 SM90 (H100) 配置的合理性 |
F1 说明:_SM100_CONFIGS(18 个条目)仍在 _get_default_config 函数体内定义,每次调用都会重建字典对象。SM100 路径已被本次 PR 正式启用,建议将其提升为类属性或模块常量,避免推理热路径上的重复分配。
F2 说明:SM80(A100)和 SM90(H100)仍共享同一套 vLLM 启发式参数,未为 A100 单独调优。作者可在 PR 中补充说明是否有意为之(如 A100 上影响可接受)。
📝 PR 规范检查
PR 标题缺少官方 Tag 前缀,且目标分支为 release/2.6 但未使用 [Cherry-Pick] 格式;PR 描述各 section 未填写实质内容。
标题建议(可直接复制):
[Cherry-Pick][Optimization] GPU-aware triton MoE tile config for SM100 (B200)(#原始PR号)
PR 描述建议(点击展开,可直接复制)
## Motivation
将 Triton MoE 的 `_get_default_config` 从纯启发式规则替换为 GPU 架构感知的预调优查找表:SM100 (B200) 使用 SGLang 针对 E=64, N=1856 实测的 18 档配置,通过最近邻匹配选取最优 tile size,提升 B200 上 MoE 层的 Triton 计算性能。
## Modifications
- `fused_moe_triton_backend.py`:`_get_default_config` 新增 `get_sm_version() >= 100` 分支,内置 SM100 查找表(M=1~4096,18 个采样点),采用 `min(..., key=lambda x: abs(x - M))` 最近邻选取
- `_get_default_config`:其余 GPU 保留原 vLLM 启发式路径不变
- `test_fused_moe_triton_backend.py`:全部 `_get_default_config` 相关测试增加 `_mock_sm90` / `_mock_sm100` monkeypatch,消除对真实 GPU 型号的依赖;新增 5 个 SM100 路径测试;`test_apply_kernel_even_ks_*` 和 `test_apply_large_batch_config` 修复 GPU-model 相关的硬编码假设
## Usage or Command
N/A
## Accuracy Tests
N/A
## Checklist
- [x] Add at least a tag in the PR title.
- Tag list: [`[FDConfig]`,`[APIServer]`,`[Engine]`, `[Scheduler]`, `[PD Disaggregation]`, `[Executor]`, `[Graph Optimization]`, `[Speculative Decoding]`, `[RL]`, `[Models]`, `[Quantization]`, `[Loader]`, `[OP]`, `[KVCache]`, `[DataProcessor]`, `[BugFix]`, `[Docs]`, `[CI]`, `[Optimization]`, `[Feature]`, `[Benchmark]`, `[Others]`, `[XPU]`, `[HPU]`, `[GCU]`, `[DCU]`, `[Iluvatar]`, `[Metax]`]
- You can add new tags based on the PR content, but the semantics must be clear.
- [ ] Format your code, run `pre-commit` before commit.
- [ ] Add unit tests. Please write the reason in this PR if no unit tests.
- [ ] Provide accuracy results.
- [x] If the current PR is submitting to the `release` branch, make sure the PR has been submitted to the `develop` branch, then cherry-pick it to the `release` branch with the `[Cherry-Pick]` PR tag.总体评价
本次变更结构清晰,SM100 lookup table 数值来源有据可查,测试覆盖完善且正确修复了 GPU-model 相关的测试硬编码。两个历史遗留问题(热路径字典创建、SM80 配置合理性)仍存在,建议作者跟进说明或修复后合入。
Motivation
Modifications
Usage or Command
Accuracy Tests
Checklist
[FDConfig],[APIServer],[Engine],[Scheduler],[PD Disaggregation],[Executor],[Graph Optimization],[Speculative Decoding],[RL],[Models],[Quantization],[Loader],[OP],[KVCache],[DataProcessor],[BugFix],[Docs],[CI],[Optimization],[Feature],[Benchmark],[Others],[XPU],[HPU],[GCU],[DCU],[Iluvatar],[Metax]]pre-commitbefore commit.releasebranch, make sure the PR has been submitted to thedevelopbranch, then cherry-pick it to thereleasebranch with the[Cherry-Pick]PR tag.